 (function(global){
    //{"static":{},"parent":function(){},"prototype":{}}
    var createClass=function(constructorFunction,classAttribute,isInheritPrototype){
        function _deepCopy(c,p){
            for(var attr in p){
                if(typeof p[attr] === 'object'){
                    c[attr]=(p[attr].constructor===Array)?[]:{};
                    _deepCopy(c[attr],p[attr]);
                }else{
                    c[attr]=p[attr];
                }
            }
        }
        function object(o){
            var f= function(){};
            f.prototype = o;
            return new f();
        }
        function _extendCopy(c,p) {
            for (var i in p) {
                c[i] = p[i]; 
            }
        }
        function extendCallParent(Child, Parent) {
            Child.prototype = object(Parent.prototype);
            Child.prototype.constructor = Child;
            Child.super = Parent;
        }
        function mutilCopy(){
            var len = arguments.length;
            if(len<=2) return {};
            var isDeep = arguments[0];
            for (var i = 2; i < len; i++) {
                if(isDeep){
                    _deepCopy(arguments[1],arguments[i]);
                }else{
                    _extendCopy(arguments[1],arguments[i]);
                }
            }
        }
        var childrenClass =null,classAttribute=classAttribute||{},F=function(){},constructFunction=constructorFunction||F
        var staticMethods = classAttribute["static"]||{},parentClass = classAttribute["parent"]||F,prototype = classAttribute["prototype"]||{};
        if(isInheritPrototype){
            childrenClass = constructFunction;
            mutilCopy(true,childrenClass.prototype,parentClass.prototype);//deep copy parent prototype attr
            childrenClass.prototype.constructor = childrenClass;//index constructor
        }else{
            childrenClass=function(){
                childrenClass.super.prototype.constructor.apply(this,arguments);
                constructFunction.apply(this,arguments);
            }
            extendCallParent(childrenClass, parentClass);
        }
        for(var sattr in staticMethods){//static method
            childrenClass[sattr]=staticMethods[sattr];
        }
        mutilCopy(false,childrenClass.prototype,prototype);//copy prototype attr and method
        return childrenClass;
    };
    global["Class"]=createClass;
})(window);